<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
	<head>
		<title>用户金库</title>
		<base href="<%=basePath%>" />
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<meta name="apple-mobile-web-app-title" content="Amaze UI" />
		<link rel="stylesheet" href="layui/css/layui.css" media="all"> <!-- 适应所有设备 -->
		<style type="text/css">
		</style>
	</head>
	<% String nowDay = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); %>
	<body>
	    
	   <table class="layui-table" lay-skin="nob" id="userTable" lay-filter="userTable"></table>
	   <input type="text" id="UserId">
	
	    <script src="js/jquery.min.js"></script>
		<script src="layui/layui.js"></script>
		<script>
		    layui.use(['layer','table'],function(){
		    	var layer = layui.layer,
		    	    table = layui.table;
		    	    
		    	setTimeout(function(){ 
	    			table.render({
			    		elem:'#userTable',
			    		url:'treasury/UserIdWoods',
			    		method:'POST',
			    		even:true,
			    		cellMinWidth:80,
			    		id:'AllTable',
			    		page:false,
			    		where:{
			    			UserId:$('#UserId').val()
			    		},
			    		cols:[[
			    			{field: 'ItemName',title: '物品名称'}, 
							{field: 'ItemCount',title: '物品数量'}
			    		]],
			    		response: {
							statusCode: 200
							//重新规定成功的状态码为 200，table 组件默认为 0
						},
						parseData: function(res) { //将原始数据解析成 table 组件所规定的数据
							return {
								"code": res.status, //解析接口状态
								"msg": res.message, //解析提示文本
								"count": res.count, //解析数据长度
								"data": res.data //解析数据列表
								//解析数据列表
							};
						}
					});
		    	},500);
		    });
		</script>
    </body>
</html>